<template>
    <div class="easyd-weixin-Box">

        <div class="app_page_box" style="bottom: 50px;">
            <div class="app_page">
                <div class="app_list_box MARGIN_BOTTOM_10">

                    <div class="history_follow_info">
                        <div class="app_box_content_textarea">
                            <textarea maxlength="1000" v-model="followQuicks.name" rows="8" cols=""></textarea>
                            <span>{{followQuicks.name.length}}/1000</span>
                        </div>
                    </div>

                    <div class="app_box_content">
                        <div class="app_box_content_right" @click="selectFollowQuick()">
                            快捷跟进
                            <span class="fa fa-angle-right fa-lg"></span>
                        </div>
                    </div>

                </div>

                <div class="app_list_box MARGIN_BOTTOM_10">
                    <div class="app_box_content">
                        <div class="app_box_content_left">
                            跟进方式
                        </div>
                        <div class="app_box_content_right" @click="selectFollowType()">
                            <span class="C4">{{followType.name == undefined ? followType:followType.name}}</span>
                            <i class="fa fa-angle-right fa-lg"></i>
                        </div>
                    </div>
                    <div class="app_box_content">
                        <div class="app_box_content_left">
                            下次跟进时间
                        </div>
                        <div class="app_box_content_right" @click="selectFollowTime()">
                            <span class="C4">{{followTime}}</span>
                            <i class="fa fa-angle-right fa-lg"></i>
                        </div>
                    </div>
                    <div class="app_box_content">
                        <div class="app_box_content_left">
                            客户评定
                        </div>
                        <div class="app_box_content_right" @click="selectFollowEvaluate()">
                            <span class="C4">{{followEvaluate.name == undefined ? followEvaluate:followEvaluate.name}}</span>
                            <i class="fa fa-angle-right fa-lg"></i>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="app_bottom_box" @click="submit()">
            <div class="app_bottom_box_right">
                提交
            </div>
        </div>

    </div>
</template>

<script>
    import {mapState, mapMutations} from "vuex";

    export default {

        data() {
            return {
//              tempFollowQuick: ''
            };
        },
        computed: {
            ...mapState({
                followType: state => state.AddFollowModule.followType,
                followEvaluate: state => state.AddFollowModule.followEvaluate,
                followQuicks: state => state.AddFollowModule.followQuicks,
                followTime: state => state.AddFollowModule.followTime,
            })
        },
        mounted() {
        	
        },
        methods: {

            //  ...mapMutations(["ShopIndexModule/updateIsShopGuide"]),

            selectFollowType(e) {
                this.$easyUtil.GO(this, '/followType');
            },
            selectFollowTime(e) {
                this.$easyUtil.GO(this, '/followTime');
            },
            selectFollowEvaluate(e) {
                this.$easyUtil.GO(this, '/followEvaluate');
            },
            selectFollowQuick(e) {
                this.$easyUtil.GO(this, '/followQuick');
            },
            /*makeUpText() {
                this.$store.commit("AddFollowModule/updateFollowQuick", this.tempFollowQuick);
                console.log(this.followQuick)
            },*/
            submit() {
                var param = {
                    cfr_cid: this.$route.query.customerId,
                    cfr_uid: this.$userData.getUID(),
                    cfr_content: this.followQuicks.name,
                    cfr_way: this.followType.id,
                    cfr_next_time: new Date(this.followTime) / 1000,
                    cfr_name: this.$userData.getNickname(),
                    c_evaluation: this.followEvaluate.id,
                };

                console.log(param);
                // return;
                this.$easyUtil.startLoading(this)
                this.$http.postHttp(this.$API.apiAddingFollowUpRecords, param, (rs) => {

                    this.$easyUtil.endLoading(this)
                    this.$easyUtil.successToast(this, '跟进添加成功');
                    this.$store.commit('AddFollowModule/clearFollowData');
                    history.go(-1);

                })
            }
        }
    };
</script>

<style lang="stylus" scoped>
    @import '~PUBLIC_CSS';
    .history_follow_info {
        padding: 10px;
        border-bottom: 1px solid #f1f1f1;
    }

    .history_follow_info .app_box_content_textarea {
        padding: 0;
        position: relative;
    }

    .history_follow_info .app_box_content_textarea textarea {
        background: #F4F4F4;
        padding: 10px;
    }

    .history_follow_info .app_box_content_textarea span {
        position: absolute;
        right: 1px;
        bottom: 1px;
        font-size: small;
        color: #999;
        background: #f4f4f4;
        padding: 5px;
    }

</style>